package com.ruoyi.items.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.items.mapper.TbOrderItemsMapper;
import com.ruoyi.items.domain.TbOrderItems;
import com.ruoyi.items.service.ITbOrderItemsService;

/**
 * 订单项表Service业务层处理
 * 
 * @author txt
 * @date 2025-02-05
 */
@Service
public class TbOrderItemsServiceImpl implements ITbOrderItemsService 
{
    @Autowired
    private TbOrderItemsMapper tbOrderItemsMapper;

    /**
     * 查询订单项表
     * 
     * @param orderItemId 订单项表主键
     * @return 订单项表
     */
    @Override
    public TbOrderItems selectTbOrderItemsByOrderItemId(Long orderItemId)
    {
        return tbOrderItemsMapper.selectTbOrderItemsByOrderItemId(orderItemId);
    }

    /**
     * 查询订单项表列表
     * 
     * @param tbOrderItems 订单项表
     * @return 订单项表
     */
    @Override
    public List<TbOrderItems> selectTbOrderItemsList(TbOrderItems tbOrderItems)
    {
        return tbOrderItemsMapper.selectTbOrderItemsList(tbOrderItems);
    }

    /**
     * 新增订单项表
     * 
     * @param tbOrderItems 订单项表
     * @return 结果
     */
    @Override
    public int insertTbOrderItems(TbOrderItems tbOrderItems)
    {
        return tbOrderItemsMapper.insertTbOrderItems(tbOrderItems);
    }

    /**
     * 修改订单项表
     * 
     * @param tbOrderItems 订单项表
     * @return 结果
     */
    @Override
    public int updateTbOrderItems(TbOrderItems tbOrderItems)
    {
        return tbOrderItemsMapper.updateTbOrderItems(tbOrderItems);
    }

    /**
     * 批量删除订单项表
     * 
     * @param orderItemIds 需要删除的订单项表主键
     * @return 结果
     */
    @Override
    public int deleteTbOrderItemsByOrderItemIds(Long[] orderItemIds)
    {
        return tbOrderItemsMapper.deleteTbOrderItemsByOrderItemIds(orderItemIds);
    }


    public List<TbOrderItems> getDetailInfo(Long orderId){
        return   tbOrderItemsMapper.getDetailInfo(orderId);
    }

    /**
     * 删除订单项表信息
     * 
     * @param orderItemId 订单项表主键
     * @return 结果
     */
    @Override
    public int deleteTbOrderItemsByOrderItemId(Long orderItemId)
    {
        return tbOrderItemsMapper.deleteTbOrderItemsByOrderItemId(orderItemId);
    }
}
